feat(kueue): Add Kueue resource wrappers with RHOAI 2.25/3.5 compatibility - #2782
feat(kueue): Add Kueue resource wrappers with RHOAI 2.25/3.5 compatibility#2782jstourac wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 35 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
WalkthroughAdds generated Kueue resource wrappers for queues, workloads, resource flavors, and operator configuration. The wrappers define typed constructor fields, initialize inherited resource state, and serialize configured values into Kubernetes ChangesKueue resource wrappers
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoAdd Kueue CRD resource wrappers with cross-version (RHOAI 2.25/3.x) support
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1. Invalid ClusterQueue spec combo
|
| _spec["admissionChecks"] = self.admission_checks | ||
|
|
||
| if self.admission_checks_strategy is not None: | ||
| _spec["admissionChecksStrategy"] = self.admission_checks_strategy |
There was a problem hiding this comment.
4. Invalid clusterqueue spec combo 🐞 Bug ≡ Correctness
ClusterQueue.to_dict() can serialize both spec.admissionChecks and spec.admissionChecksStrategy when both constructor args are provided, even though the API contract (documented in this class) says they cannot be used together. This produces a manifest that violates the documented API constraints and may fail server-side validation or behave unexpectedly.
Agent Prompt
### Issue description
`ClusterQueue` documents that `admissionChecks` cannot be used together with `admissionCheckStrategy`, but the wrapper currently allows both inputs and will emit both fields in `spec` when both are set.
### Issue Context
This is a newly added generated wrapper; adding a small guard is consistent with other resources in this repo that raise early (e.g., `MissingRequiredArgumentError`) when required/invalid combinations are detected.
### Fix Focus Areas
- ocp_resources/cluster_queue.py[16-36]
- ocp_resources/cluster_queue.py[113-126]
### Suggested fix
Add a guard in `__init__` or `to_dict` such as:
```python
if self.admission_checks is not None and self.admission_checks_strategy is not None:
raise ValueError("admission_checks and admission_checks_strategy are mutually exclusive")
```
(Optionally use `MissingRequiredArgumentError` or a new dedicated exception if that’s preferred in this codebase.)
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
this should be addressed already
…ility Add wrapper classes for Kueue resources needed by opendatahub-tests for Kueue integration testing. All wrappers use a superset of fields from both kueue.x-k8s.io/v1beta1 (RHOAI 2.25) and v1beta2 (RHOAI 3.x) to support cross-version compatibility. Resources added: - ResourceFlavor (kueue.x-k8s.io, cluster-scoped) - LocalQueue (kueue.x-k8s.io, namespaced) - ClusterQueue (kueue.x-k8s.io, cluster-scoped) - Workload (kueue.x-k8s.io, namespaced) - Kueue (components.platform.opendatahub.io, cluster-scoped) — RHOAI 2.25 - Kueue (kueue.openshift.io, cluster-scoped) — RHOAI 3.x Version-specific fields are documented in docstrings. The API server handles validation; no client-side version checks are performed. Also adds KUEUE_X_K8S_IO and KUEUE_OPENSHIFT_IO constants to the ApiGroup enum and updates the schema mappings. Co-authored-by: Cursor <cursoragent@cursor.com>
Add wrapper classes for Kueue resources needed by opendatahub-tests for Kueue integration testing. All wrappers use a superset of fields from both kueue.x-k8s.io/v1beta1 (RHOAI 2.25) and v1beta2 (RHOAI 3.x) to support cross-version compatibility.
Resources added:
Version-specific fields are documented in docstrings. The API server handles validation; no client-side version checks are performed.
Also adds KUEUE_X_K8S_IO and KUEUE_OPENSHIFT_IO constants to the ApiGroup enum and updates the schema mappings.
What this PR does / why we need it:
https://redhat.atlassian.net/browse/RHOAIENG-73662
opendatahub-io/opendatahub-tests#2142
Which issue(s) this PR fixes:
Special notes for reviewer:
Bug:
Summary by CodeRabbit